<template>
  <div class="search">
      <div class="searchList">
          <li  class="list" v-for="(item,key) of cities" :key="key" @click="listClick">{{key}}</li>
      </div>
  </div>
</template>

<script>
export default {
  name: "CitySearch",
  props: {
    cities: Object
  },
  methods: {
    listClick(e){
        this.$emit('change',e.target.innerText)
    }
  }
};
</script>

<style scoped>
.search {
  height: 100%;
  position: absolute;
  right: 0.1rem;
  font-size: 0.15rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #00bcd4;
}
.list {
  padding-bottom: 0.05rem;
}
</style>